﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Assignment2.Conditions;
using Assignment2.States;

namespace Assignment2.Transitions
{
    class WaitingToSleepingTransition : Transition
    {
        public WaitingToSleepingTransition(ref Integer boringValue, ref Integer hungryValue, ref Integer toyValue, ref Integer foodValue, ref Integer idleTime)
            : base()
        {
            Condition notHungry = new IsLesserThanCondition(hungryValue, new Integer(1080));
            Condition notBored = new IsLesserThanCondition(boringValue, new Integer(1080));
            Condition notInteracted= new IsGreaterThanCondition(idleTime, new Integer(720));
            condition = new AndCondition(new AndCondition(notHungry, notHungry), notInteracted);
        }

        public override void updateMember()
        {
            targetState = StateAndTransitionPool.Sleeping;
        }
    }
}
